<nb-card>
  <nb-card-body><span style="font-weight: bold">病人无线定位系统</span></nb-card-body>
</nb-card>
<nb-alert *ngIf="error!=null && error.length>0" outline="danger" role="alert">{{error}}</nb-alert>
<nb-accordion multi="true">
  <nb-accordion-item>
    <nb-accordion-item-header>
      病区信息
    </nb-accordion-item-header>
    <nb-accordion-item-body>
      <div class="input-rows">
        <input nbInput [(ngModel)]="zone_edit.name" placeholder="病区名称">
        <input nbInput [(ngModel)]="zone_edit.contactPerson" placeholder="联系人姓名">
        <input nbInput [(ngModel)]="zone_edit.contactPhone" placeholder="联系电话">
        <button nbButton (click)="addZone()">添加</button>
      </div>
      <ng2-smart-table [settings]="zone_settings" [source]="zone_source"></ng2-smart-table>
    </nb-accordion-item-body>
  </nb-accordion-item>
  <nb-accordion-item expanded="true">
    <nb-accordion-item-header>
      病人信息
    </nb-accordion-item-header>
    <nb-accordion-item-body>
      <div class="input-rows">
        <input [(ngModel)]="edit_patientName" placeholder="病人姓名" nbInput>
        <input [(ngModel)]="edit_cardId" placeholder="手环编号" nbInput>
        <nb-select [(selected)]="edit_sex">
          <nb-option value="男">男</nb-option>
          <nb-option value="女">女</nb-option>
        </nb-select>
        <input [(ngModel)]="edit_age" placeholder="出生年份" nbInput>
        <nb-select [(selected)]="edit_zone" (selectedChange)="selectZone()">
          <nb-option *ngFor="let data of zone_source.data" [value]="data.name">{{data.name}}</nb-option>
        </nb-select>
        <input [(ngModel)]="edit_contactPerson" placeholder="联系人姓名" nbInput>
        <input [(ngModel)]="edit_contactPhone" placeholder="联系电话" nbInput>
        <button nbButton (click)="add()">添加</button>
      </div>
      <ng2-smart-table [settings]="settings" [source]="source"></ng2-smart-table>
    </nb-accordion-item-body>
  </nb-accordion-item>
</nb-accordion>
